<?php

	function getUserArticleAuth($cid = 0) {
		$userInfo = config('userInfo');
		if (!$userInfo) {
			return [];
		}
		$group_id = $userInfo['group_id'];
    	$articleUserGroupExtend = model('app\article\model\Articles')->getUserGroupExtendData($cid,$group_id);
		return $articleUserGroupExtend;
	}
	
	function getUserArticleAuthList() {
		$userInfo = config('userInfo');
		if (!$userInfo) {
			return [];
		}
		$group_id = $userInfo['group_id'];
		$categoryList = db('ArticlesCategory')->select(); 
		if ($categoryList) {
    		$articleUserGroupExtend[0] = model('app\article\model\Articles')->getUserGroupExtendData(0,$group_id);;
        	foreach($categoryList as $key => $categoryInfo) {
	        	$articleUserGroupExtend[$categoryInfo['id']] = model('app\article\model\Articles')->getUserGroupExtendData($categoryInfo['id'],$group_id,$categoryInfo);
        	}
        }
		return $articleUserGroupExtend;
	}